package pri.black.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@Slf4j
@ControllerAdvice
public class ViewExceptionHandlerConfig {
    @ExceptionHandler(AccessDeniedException.class)
    String handlerAccessDeniedException(BindException e){
        log.debug("操作失败:{}", e.getMessage());
        return "403";
    }
    @ExceptionHandler(BindException.class)
    String handlerBindException(BindException e){
        log.debug("操作失败:{}", e.getMessage());
        return "123";
    }
}
